﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Site : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session.GetCurrentUser() == null)
        {
            page_title.Text = "";
        }else
            page_title.Text = String.Format( "Welcome {0}!", Session.GetCurrentUser( ) );
    }

    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        if (Request.Url.PathAndQuery.Contains("LoginForm.aspx"))
            ;
        else if (Session.GetCurrentUser() == null)
            Response.Redirect("~/Login/LoginForm.aspx?returnUrl=" + Request.Url.PathAndQuery);
        else
            Response.Redirect("~/Login/Logout.aspx");
    }
}
